# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ServiceControl.V2.Model.CheckResponse do
  @moduledoc """
  Response message for the Check method.

  ## Attributes

  *   `dynamicMetadata` (*type:* `map()`, *default:* `nil`) - Optional response metadata that will be emitted as dynamic metadata to be consumed by the caller of ServiceController. For compatibility with the ext_authz interface.
  *   `headers` (*type:* `map()`, *default:* `nil`) - Returns a set of request contexts generated from the `CheckRequest`.
  *   `status` (*type:* `GoogleApi.ServiceControl.V2.Model.Status.t`, *default:* `nil`) - Operation is allowed when this field is not set. Any non-'OK' status indicates a denial; google.rpc.Status.details would contain additional details about the denial.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dynamicMetadata => map() | nil,
          :headers => map() | nil,
          :status => GoogleApi.ServiceControl.V2.Model.Status.t() | nil
        }

  field(:dynamicMetadata, type: :map)
  field(:headers, type: :map)
  field(:status, as: GoogleApi.ServiceControl.V2.Model.Status)
end

defimpl Poison.Decoder, for: GoogleApi.ServiceControl.V2.Model.CheckResponse do
  def decode(value, options) do
    GoogleApi.ServiceControl.V2.Model.CheckResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ServiceControl.V2.Model.CheckResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
